package com.zmn.plat.model.entity.channel;

import com.zmn.common.utils.pager.Operator;

import java.util.Date;
import java.util.Objects;

/**
 * @author tanghongjun
 * @version v1.0
 * @since 2018/11/07 15:10
 * @类说明：渠道接口实体
 */
public class ChannelInterface extends Operator {
    private Integer interfaceId;

    /**
     * 合作方ID
     */
    private Integer channelId;

    /**
     * 接口类型：1状态变更，2新单同步，3：变更+新单同步
     */
    private Integer interfaceType;

    /**
     * 接口状态推送URL
     */
    private String interfaceStatusUrl;

    /**
     * 接入密钥
     */
    private String appSecret;

    /**
     * ip白名单
     */
    private String ipWhitelist;

    /**
     * 接口新单推送URL
     */
    private String interfaceUrl;

    /**
     * 状态：1停用，2启用
     */
    private Integer status;

    /**
     * 创建人
     */
    private String creater;

    /**
     * 最新修改人
     */
    private String updater;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 最新修改时间
     */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public Integer getInterfaceId() {
        return interfaceId;
    }

    public void setInterfaceId(Integer interfaceId) {
        this.interfaceId = interfaceId;
    }

    public Integer getChannelId() {
        return channelId;
    }

    public void setChannelId(Integer channelId) {
        this.channelId = channelId;
    }

    public Integer getInterfaceType() {
        return interfaceType;
    }

    public void setInterfaceType(Integer interfaceType) {
        this.interfaceType = interfaceType;
    }

    public String getInterfaceUrl() {
        return interfaceUrl;
    }

    public void setInterfaceUrl(String interfaceUrl) {
        this.interfaceUrl = interfaceUrl;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    public String getUpdater() {
        return updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getInterfaceStatusUrl() {
        return interfaceStatusUrl;
    }

    public void setInterfaceStatusUrl(String interfaceStatusUrl) {
        this.interfaceStatusUrl = interfaceStatusUrl;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    public String getIpWhitelist() {
        return ipWhitelist;
    }

    public void setIpWhitelist(String ipWhitelist) {
        this.ipWhitelist = ipWhitelist;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ChannelInterface)) {
            return false;
        }
        ChannelInterface that = (ChannelInterface) o;
        return Objects.equals(getInterfaceId(), that.getInterfaceId()) && Objects.equals(getChannelId(), that.getChannelId()) && Objects.equals(getInterfaceType(), that.getInterfaceType()) && Objects.equals(getInterfaceStatusUrl(), that.getInterfaceStatusUrl()) && Objects.equals(getAppSecret(), that.getAppSecret()) && Objects.equals(getIpWhitelist(), that.getIpWhitelist()) && Objects.equals(getInterfaceUrl(), that.getInterfaceUrl()) && Objects.equals(getStatus(), that.getStatus()) && Objects.equals(getCreater(), that.getCreater()) && Objects.equals(getUpdater(), that.getUpdater()) && Objects.equals(getCreateTime(), that.getCreateTime()) && Objects.equals(getUpdateTime(), that.getUpdateTime());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getInterfaceId(), getChannelId(), getInterfaceType(), getInterfaceStatusUrl(), getAppSecret(), getIpWhitelist(), getInterfaceUrl(), getStatus(), getCreater(), getUpdater(), getCreateTime(), getUpdateTime());
    }

    @Override
    public String toString() {
        return "ChannelInterface{" + "interfaceId=" + interfaceId + ", channelId=" + channelId + ", interfaceType=" + interfaceType + ", interfaceStatusUrl='" + interfaceStatusUrl + '\'' + ", appSecret='" + appSecret + '\'' + ", ipWhitelist='" + ipWhitelist + '\'' + ", interfaceUrl='" + interfaceUrl + '\'' + ", status=" + status + ", creater='" + creater + '\'' + ", updater='" + updater + '\'' + ", createTime=" + createTime + ", updateTime=" + updateTime + '}';
    }
}